package day0320;

import java.util.Arrays;

public class Test7 {
    public static void main(String[] args) {
        //1.定义一个存储了四个数的数组nums
        int[]  nums={5,6,7,3,4};
        //2.数组逆序排列
        for (int i = 0; i < 5/2; i++) {
            //将数组的第i个元素和第4-i个元素交换
            int t=nums[i];
            nums[i]= nums[4-i];
            nums[4-i]=t;
        }
        //3.打印数组
        System.out.println(Arrays.toString(nums));
    }
}
